package com.kaishengit.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.kaishengit.dao.UserDao;
import com.kaishengit.pojo.Group;
import com.kaishengit.pojo.User;
@Transactional
public class UserService {
	private UserDao userDao;
	public User findByUsername(User user) {
		return userDao.findByUnique("username", user.getUsername());
		
	}
	//根据小组找用户
	@SuppressWarnings("unchecked")
	public List<User> findByGroupId(Group g) {
		return userDao.findAllByProperty("group", g);
	}
	
	
	//set
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}



	




	
	
}
